﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
namespace version1
{
    public abstract class Visible : GameEntity
    {
        private float delay;

        public float Delay
        {
            get { return delay; }
            set { delay = value; }
        }
        public Vector2 _Size;

        public Vector2 Size
        {
            get { return _Size; }
            set { _Size = value; }
        }
        public Vector2 _TopLeft;

        public Vector2 TopLeft
        {
            get { return _TopLeft; }
            set { _TopLeft = value; }
        }

        public List<Sprite2D> sprite;

        public List<Sprite2D> Sprite
        {
            get { return sprite; }
            set { sprite = value; }
        }
        public int nsprite;

        public int Nsprite
        {
            get { return nsprite; }
            set { nsprite = value; }
        }
        public int isprite;

        public int Isprite
        {
            get { return isprite; }
            set { isprite = value; }
        }
        virtual public void Update(GameTime gametime)
        {
            for (int i = 0; i < nsprite; i++)
                sprite[i].Update(gametime);
        }

       
        virtual public void Draw(SpriteBatch spritebatch, GameTime gameTime)
        {
            for (int i = 0; i < nsprite; i++)
                sprite[i].Draw(spritebatch, gameTime);
        }
        virtual public bool isclick(Vector2 point)
        {
            if ((point.X >= _TopLeft.X && point.X <= _TopLeft.X + _Size.X) && (point.Y >= _TopLeft.Y && point.Y <= _TopLeft.Y + _Size.Y))
            {
                return true;
            }
            return false;
        }
    }
}
